<template>
    <van-nav-bar title="列表页" />
    <div v-for="item in searchApiData">
        <van-card :price="item.goods_price" :title="item.goods_name"
            :thumb="item.goods_small_logo ? item.goods_small_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
    </div>
</template>

<script setup>
import { searchApi } from '@/api/api';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let searchApiData = ref([])
let route = useRoute()
searchApi(route.params.query).then(res => {
    searchApiData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>